<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body style="height: 3000px">
  <div id="app">
    <common-head></common-head>
  </div>
  <script src="./vue.js"></script>
  <script src="./axios.js"></script>
  <script>
    const CommonLogo = {
      template: `
        <div>
          <header>这是头部</header>  
          <slot msg="这是静态数据" :arr="arr"></slot>
          <footer>这是尾部</footer>  
        </div>
      `,
      data(){
        return {
          arr: ['a', 'b', 'c', 'd']
        }
      }
    }
    const CommonHead = {
      template: `
        <div>
          <h1>这是公共组件</h1>
          <common-logo>
            <div slot-scope="data">
              {{ data.msg }}
              <ul>
                <li v-for="item in data.arr" :key="item">
                  {{ item }}  
                </li>  
              </ul>
            </div>  
          </common-logo>
          <hr/>
        </div>
      `,
      components: {
        CommonLogo
      }
    }
    Vue.component('CommonHead', CommonHead)
    const vm = new Vue({
      el: '#app'
    })


  </script>
</body>
</html>